import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)

import mutations from './mutations'
import actions from './action'
import getters from './getters'
import vuexI18n from 'vuex-i18n'


var userInfo ;
 try{
	userInfo = JSON.parse( localStorage.userInfo )
 }catch(e){
	 userInfo = {}
 }

const state = {
	userInfo: userInfo, //用户信息,默认为缓存中的值
}

var store;
export default store = new Vuex.Store({
	modules: {
		i18n: vuexI18n.store
	},
	state,
	getters,
	actions,
	mutations
})

Vue.use(vuexI18n.plugin, store)
Vue.i18n.add('en', {"content": "This is some {type} content"});
Vue.i18n.set('en');
